package com.hhh.corejava.code07_面向对象;

/**
 * @autor 黄焕晖
 * @date 2025年11月01日19:58
 **/
public class Test06_方法重载 {
    public static void main(String[] args) {

    Calculator calculator = new Calculator();
        System.out.println(calculator.sum(1,2));
        System.out.println(calculator.sum(1,2.0));
        System.out.println(calculator.sum(1.0,2));
        System.out.println(calculator.sum(1.0,2.0));
        System.out.println(calculator.sum(1,2,3));
}

}

class Calculator{
    public int sum(int i ,int j){
        return i+j;
    }
    public int sum(int i ,int j,int k){
        return i+j+k;
    }

    public double sum(double i ,int j){
        return i+j;
    }
    public double sum(int i ,double j){
        return i+j;
    }
    public double sum(double i ,double j){
        return i+j;
    }
}
